package com.xzq.erp.controller;


import com.xzq.erp.aspect.ApiOperationLog;
import com.xzq.erp.domain.vo.IdAndNameVO;
import com.xzq.erp.service.IProductUnitService;
import com.xzq.erp.utils.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品计量单位表 前端控制器
 * </p>
 *
 * @author xzq
 * @since 2025-05-26
 */
@RestController
@RequestMapping("/product-unit")
@Tag(name = "商品计量单位接口")
@RequiredArgsConstructor
public class ProductUnitController {

    private final IProductUnitService productBrandService;

    @GetMapping
    @Operation(summary = "查询商品单位列表")
    @ApiOperationLog(description = "查询商品单位列表")
    public Response<List<IdAndNameVO>> getProductUnitList() {
        return Response.success(productBrandService.getProductUnitList());
    }
}
